trigger CopyCustomerName on Address__c (before insert, before update) {
if (Trigger.new.size() > 0){
for (Address__c addr:Trigger.new)
{
  if (addr.name!=null)
  {
    Trigger.new[0].customer_name_id__c = addr.name;
  }
}
}
}